<#assign ctx = request.contextPath/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>人事管理系统 ——后台登录</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />    
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />
		<link href="${ctx}/css/css.css" type="text/css" rel="stylesheet" />
		<script type="text/javascript" src="${ctx}/js/jquery-1.11.0.js"></script>
	</head>
	<body background="${ctx}/images/9.png">
		<div class="log_black1"></div>
		<div id="showOrHide">
			<div id="login_main">
			  <div class="login_main_tab">
			    <div class="log_main_t_top"></div>
			    <div class="log_main_t_mid">
				  	<div class="log_black2"></div>
					<form  method="post" id="loginForm" >
					  <div class="log_input">用户名:<input type="text" id="name" name="name" value="lance" size="20" ></div>
					  <div class="log_input">密　码:<input type="pass_word" id="pass_word" value="123456" name="pass_word" ></div>
					  <div class="log_input">
					  	<table><tr>
					  		<td style="font-size:12px; color:#296dcc;">
					  			验证码:<input type="text" style="margin-left:5px;width:35px;" id="code" name="code" maxlength="4"/>
					  		</td>
					  		<td>
					  			<img title="验证码" width="55" height="20" id="vimg" src="${ctx}/CheckController">					  			
					  		</td>
					  		<script type="text/javascript">
								$(function(){
									$("#vimg").click(function(){
										
										$("#vimg").attr("src","${ctx}/CheckController?id="+Math.random());
									});
									$("#change").click(function(){
										$("#vimg").attr("src","${ctx}/CheckController?id="+Math.random());
									});
									
									$("#loginBtn").click(function(){
										//ajax登录功能
										var name = $("#name").val();
										var pass_word = $("#pass_word").val();
										var code = $("#code").val();
										$.post("${ctx}/admin/user/login",{"name":name,"pass_word":pass_word,"code":code},function(data){
											
											if(data.status == "success"){
												window.location.href = "${ctx}/admin/user/toHome";
											}									
										});	
									});							
								});
							</script>
					  		<td><a href="javascript:void(0)" id="change">看不清楚</a></td>
					  	</tr></table>
					  </div>
					  
					  <div class="log_button"><input type="button" id="loginBtn" value="登 录" onClick="loginFn()" >&nbsp;&nbsp;<input type="reset" value="重 置" ></div>
					</form>
				</div>
			    <div class="log_main_t_bottom"></div>
			  </div>
			</div>			
		</div>
	</body>
</html>